<!-- 2015.03.11 胡雨晴 -->

<div id="login_box">
	<h2>登录</h2>
	
	<%= form_for(resource, :as => resource_name, :url => session_path(resource_name)) do |f| %>
	  <div style="display: none"><%= f.label :email %><br />
	  <%= f.email_field :email, :autofocus => true %></div>
	
	  <div style="display: none"><%= f.label :password %><br />
	  <%= f.password_field :password %></div>
	  
	  <div style="display: none"><%= f.label :identity_url %><br/>
	  <%= f.text_field :identity_url %></div>
	  
	  
		  <div class="form-group">
		  	<input type="text" id="uer_name"  placeholder="用户名" />
		  </div>	  
			
		  <div class="login_btn">
		  	<!-- <%=button_tag "登录" ,:id => "submit_btn",:type => "button"%> -->
		    <input type="button" id="submit_btn" class="btn btn-primary " value="登录">
		  </div>
		  
		  <div style="display: none"><%= f.submit "登录" ,:id => "login_btn"%></div>
	  
	<% end %>
</div>


<script>
	$("#submit_btn").click(function(){
		var uname = $("#uer_name").val();
		if(!isTextNull(uname)){
			$("#user_identity_url").attr("value",'http://beta.sync4.mobi/openid/'+ uname);
			// alert($("#user_identity_url").val());
			$("#login_btn").click();
		}
	});
</script>
